﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace UrlChecker
{
    public partial class Browser : Form
    {
        #region Attributes

        public string URL = "";
        public FormWindowState FormState = FormWindowState.Normal;

        #endregion


        public Browser()
        {
            InitializeComponent();
        }

        public Browser(string url,FormWindowState size)
        {
            InitializeComponent();
            URL = url;
            FormState = size;
        }

        private void Browser_Shown(object sender, EventArgs e)
        {
            if (this.URL != "")
            {
                this.webBrowser1.DocumentText = "正在进入……";
                this.webBrowser1.Navigate(this.URL);                
            }
        }

        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            this.Text = this.webBrowser1.DocumentTitle + " - " + this.URL;
        }
    }
}
